Overview

Here we explore the oil spill incidents that were reported to California Emergency Management Agency in 2008. Many of the oil spill were reported in counties along the coast and the San Francisco Bay Area. Los Angeles county had the largest number of reports oil spill incidents.

# Read in the Oil Spill data
incidents <- read_sf(here("data",layer = "Oil_Spill_Incident_Tracking_%5Bds394%5D.shp")) %>% 
  clean_names() %>% 
  mutate(incident_date = date(dateofinci)) %>% 
  rename(county_name = localecoun) # Rename county name column to be consistent with the other dataset
  

# Read in California counties data
ca_counties <- read_sf(here("data","CA_counties","CA_counties.shp")) %>% 
  clean_names() %>% 
  select(name, aland) %>% 
  rename(county_name = name, land_area = aland) # Rename county name column to be consistent with the other dataset

# Check crs for the datasets 
#st_crs(ca_counties) # `ca_counties` was loaded in as 4326
#st_crs(incidents) # `incidents` was loaded in as 3857
ca_counties <- st_transform(ca_counties, 3857) # transform so the datasets are the same, this is important for the `st_join()` later. I chose 3857 because  in is a projected coordinated system that is widely used. 4326 is a geographic coordinate system

#st_crs(ca_counties) # Check crs to ensure the `st_transform()` worked

Interactive Incident Map

# Make and interactive map to show the locations of oil spill events
# Set the viewing mode to `interactive`/"view":
tmap_mode(mode = "view")

# Make a map with the fill color updated to variable 'county_name'
tm_shape(ca_counties) +
  tm_fill("county_name", palette = "BuGn", title =" ") +
  tm_shape(incidents) + # Add a layer for the oil spill indicents and have the events plotted as dots
  tm_dots()+
  labs(title = "Oil Spill Events")

Figure 1: Individual oil spill events in the state of California in 2008. Data is from CA DFW Oil Spill Incident Tracking.

Static Chloropleth Map of Incidents by County

# Make an static map
# note to self see lab 5
incident_subset <- incidents %>% # Make a subset.. 
  filter(inlandmari == "Inland") %>% # with only the mainland incidents ..
  select(county_name) # and the county name.
# Join the datasets so we can find the counts of incidents for each county in the next step
ca_incidents <- ca_counties %>% # My R studio won't let me view this dataset
  st_join(incident_subset) 

incident_counts <- ca_incidents %>% # Find the incident count for each county
  count(county_name.x)

# Make a chloropleth plot using the number of incidents as the fill color
ggplot(data = incident_counts) +
  geom_sf(aes(fill = n), color = "white", size = 0.1) +
  scale_fill_gradientn(colors = c("lightgoldenrod1","orange","red")) +
  theme(panel.background = element_rect(fill = "lightblue1",
                                colour = "lightblue1",
                                size = 0.5, linetype = "solid")) +
  labs(title = "Oil Spills on the Mainland of the State of California", subtitle = "Events reported to CA EMA in 2008 (WEE)", fill = "Number of Oil Spills", x="Latitude", y="Longitude")
**Figure 2:** Mainland oil spill events shown for each California county in 2008. Data is from CA DFW Oil Spill Incident Tracking

Figure 2: Mainland oil spill events shown for each California county in 2008. Data is from CA DFW Oil Spill Incident Tracking

Data Citation

Oil SPill Incident Tracking [ds394] Updated: 31-01-2020 Accessed on: 19-02-2021

https://gis.data.ca.gov/datasets/7464e3d6f4924b50ad06e5a553d71086_0/data